/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aso.upna.busControl;

import cliente.Reproductor;
import org.gstreamer.Bus;
import org.gstreamer.Gst;
import org.gstreamer.GstObject;
import org.gstreamer.elements.PlayBin;

/**
 *
 * @author triki
 */
public class BusError implements Bus.ERROR {

    private PlayBin playbin;
    private Reproductor rep;

    public BusError(PlayBin playbin,Reproductor rp)
    {
        this.playbin = playbin;
        rep = rp;
    }

    public void errorMessage(GstObject arg0, int arg1, String message) {
        rep.setEnd(true);
        System.out.println("Error occurred: " + message);
        Gst.quit();
    }

}
